package cn.wenhe9.yygh.hosp.controller;

import cn.wenhe9.yygh.common.result.ResultResponse;
import cn.wenhe9.yygh.hosp.service.DepartmentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author DuJinliang
 * 2022/3/31
 */
@Api(tags = "科室管理")
//@CrossOrigin
@RestController
@RequestMapping("/admin/hosp/department")
public class DepartmentController {
    @Resource
    private DepartmentService departmentService;

    /**
     * 查询医院所有科室列表
     * @param hoscode String
     * @return ResultResponse
     */
    @ApiOperation("查询医院所有科室列表")
    @GetMapping("/list/{hoscode}")
    public ResultResponse getDeptList(@PathVariable(name = "hoscode") String hoscode){
        return departmentService.findDeptTree(hoscode);
    }
}
